Skip to content

Instantly share code, notes, and snippets.

View nicolechung's full-sized avatar

nicole chung nicolechung

View GitHub Profile
@nicolechung
nicolechung / SassMeister-input-HTML.html
Created August 18, 2014 17:35
Generated by SassMeister.com.
<div class="container">
<div class="main">
Main
</div>
<div class="sidebar">
Sidebar
</div>
</div>
// ----
// Sass (v3.2.19)
// Compass (v0.12.6)
// ----
/* nested extends with compass/sass */
@import "compass";
.nested {
.blue {
@nicolechung
nicolechung / gist:3873379
Created October 11, 2012 15:56
Actionscript: Convert straight quotes to smart quotes
function smartQuotes(value:String):String {
/*
g = global = Matches more than one match
“ = &#8220;
” = &#8221
$1 refers to the capture group (the text inbetween the quotes)
*/
var pattern = new RegExp('"([^"]+)"', "g");
var str:String = value.replace(pattern, "&#8220;$1&#8221;");
return str;
@nicolechung
nicolechung / photos_tag.rb
Created September 3, 2012 22:51 — forked from sukima/photos_tag.rb
Jekyll Plugin for easy FancyBox usage: remove "strip" and "map" to work with liquid 2.3.0 for octopress
# Title: Photos tag for Jekyll
# Authors: Devin Weaver
# Description: Allows photos tag to place photos as thumbnails and open in fancybox. Uses a CDN if needed.
#
# ** This only covers the markup. Not the integration of FancyBox **
#
# To see an unabridged explination on integrating this with [FancyBox][1]
# Please read my [blog post about it][2].
#
# [1]: http://fancyapps.com/fancybox/
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
@nicolechung
nicolechung / InstallPostgres.md
Created May 28, 2012 13:55
install postgres on vagrant lucid32

#Installing Postgres on Vagrant/lucid32

sudo apt-get install libpq-dev gem install pg

@nicolechung
nicolechung / setup.md
Created May 28, 2012 12:15
Github setup: pushing content to an empty repo

#Pushing content to an empty git repo

Sometimes you will be working on your local folder for a while before setting up a git repo online. Here is how to push content to an empty git repo.

Create your repo on github.

When asked, don't make a README.md or .gitignore file.

Copy the link:

@nicolechung
nicolechung / config-tinymce
Created May 17, 2012 15:58
Concrete5: Very minimal TINYMCE
theme : "concrete",
plugins: "inlinepopups,spellchecker,safari,advlink,table,xhtmlxtras,emotions,paste,visualchars,nonbreaking,pagebreak,style,searchreplace,fullscreen,advimage",
editor_selector : "advancedEditor",
spellchecker_languages : "+English=en",
theme_concrete_buttons1 : "styleselect,formatselect,",
theme_concrete_buttons2 : "bold,italic,|,bullist,numlist,|,outdent,indent,blockquote,|,replace,|,pastetext,pasteword,|,undo,redo,|",
theme_concrete_buttons3 : "anchor,link,unlink,|,charmap",
theme_concrete_blockformats : "p,address,pre,h1,h2,h3,div,blockquote,cite",
theme_concrete_toolbar_align : "left",
theme_concrete_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new ro
@nicolechung
nicolechung / getrecords.php
Created May 17, 2012 12:21
Concrete5: get number of records in a database
$db = Loader::db();
$res = $db->query("SELECT * FROM TableName");
echo $res->RecordCount();
@nicolechung
nicolechung / insert.php
Created May 17, 2012 12:18
Concrete5: db insert (use query instead of execute)
$db = Loader::db();
$sql = "INSERT INTO YourTableName (integer_value, string_value) VALUES (?,?)";
$vals = array(123, "this is a string with \" special ' characters in it !%¤!#&½=");
$db->query($sql, $vals);
// get the insert id
$new_id = $this->db->Insert_ID();