Skip to content

Instantly share code, notes, and snippets.

@tylerlee
tylerlee / gist:53609bff1346cebf8f0a85b6be29a88e
Last active July 11, 2023 15:07
whitelist for uploads: extensions and mimetypes
{
// Image Formats
"jpg": "image/jpeg",
"jpeg": "image/jpeg",
"gif": "image/gif",
"png": "image/png",
"bmp": "image/bmp",
"tiff": "image/tiff",
"tif": "image/tiff",
seeState: function (e) {
e.preventDefault();
console.log(this.state);
},
render: function () {
return (
<button onClick={this.seeState} />
);
});
@tylerlee
tylerlee / rss-format.xml
Created October 13, 2015 12:34
rss-format.xml
<?xml version="1.0"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:ev="http://purl.org/rss/1.0/modules/event/" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
<channel>
<title>Student Government Association Events</title>
<description>A listing of public events for Student Government Association</description>
<link>https://orgsync.com</link>
<language>en-us</language>
<item>
<link>http://orgsync.com.dev/25567/events/779397/occurrences/1617224</link>
<guid>http://orgsync.com.dev/25567/events/779397/occurrences/1617224</guid>
app.get('/results', function (request, response) {
var instagrams = [];
var tweets = [];
pg.connect(process.env.DATABASE_URL, function (err, client, done) {
client.query('SELECT * FROM tweets ORDER BY created_at DESC', function (err2, result) {
if (err2) {
console.error(err); response.send('Error ' + err2);
} else {
<form>
<dl class="form">
<dt><label>Example Text</label></dt>
<dd><input type="text" class="textfield" value="Example Value" /></dd>
</dl>
<div class="form-checkbox">
<label>
<input type="checkbox" checked="checked" />
Available for hire
<forms>
<form>
<id>29</id>
<name>Membership Application</name>
<organization>
<id>19</id>
<short_name>Ski Club</short_name>
</organization>
<description>
Please fill this out so that we can process your application to the Ski and
@tylerlee
tylerlee / head.html
Last active August 29, 2015 14:05
default-html-head.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>OrgSync Organization Template</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="icon" href="http://www.orgsync.com/images/favicon.ico" type="image/x-icon" />
[[file:orgsync_defaults]]
<% buttons = [] %>
<% buttons << link_to(icon_tag('edit') + 'Edit', '') %>
<% buttons << link_to(icon_tag('delete') + 'Delete', '') %>
<% buttons << link_to(icon_tag('upload') + 'Import', '') %>
<%= admin_button_group(buttons) %>
@tylerlee
tylerlee / AdminButtonGroup.html.erb
Last active August 29, 2015 14:04
Admin Button Group
<% buttons = [] %>
<% buttons << link_to(icon_tag('edit') + 'Edit', '') %>
<% buttons << link_to(icon_tag('delete') + 'Delete', '') %>
<% buttons << link_to(icon_tag('upload') + 'Import', '') %>
<%= admin_button_group(buttons) %>
@tylerlee
tylerlee / media-element
Created August 1, 2014 21:47
Media Element
<%= media_element profile_picture(current_user, 64) do %>
<p>Suspendisse vitae augue lectus. Sed velit nisi, molestie eu varius sit amet, condimentum tempor ligula. Duis in tellus nisl. Sed ullamcorper justo id luctus feugiat. Aenean interdum tellus id enim consequat, eget ultricies dolor dictum. Nullam feugiat lectus id molestie vestibulum. Donec pretium nisi vel vehicula tempor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed porta, augue a venenatis consequat, turpis lectus vestibulum urna, ultrices tristique justo nibh ac ante. Nam malesuada adipiscing erat. Sed accumsan mollis sapien, sed rhoncus enim ultricies a. Cras dignissim tincidunt porttitor. Ut in neque elit.</p>
<% end %>