Skip to content

Instantly share code, notes, and snippets.

@bakertim
bakertim / javascript_resources.md
Created June 1, 2014 01:48 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@bakertim
bakertim / 0_reuse_code.js
Created June 1, 2014 01:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@bakertim
bakertim / gist:10750015
Created April 15, 2014 17:26
SQL: import local csv file
mysql -u root -p --local-infile __DATABASE_NAME__
-- SQL
LOAD DATA LOCAL INFILE '__relative_path_to_file' INTO TABLE __TABLE_NAME__ FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1, field2);
@bakertim
bakertim / gist:10749775
Created April 15, 2014 17:23
SQL - turn off set foreign key check
SET foreign_key_checks = 0;
-- SQL commands here
SET foreign_key_checks = 1;
@bakertim
bakertim / gist:9987802
Created April 5, 2014 05:21
objective-c: XCode 5.1 Fixes broken plugin
<!-- For XCode 5.1 plugins that don't work -->
<!-- 1. Edit the plugin's info.plist file -->
<!-- 2. Add the value A2E4D43F-41F4-4FB9-BB94-7177011C9AED to the key DVTPlugInCompatibilityUUIDs as shown below -->
<key>DVTPlugInCompatibilityUUIDs</key>
<array>
<string>A2E4D43F-41F4-4FB9-BB94-7177011C9AED</string>
</array>
@bakertim
bakertim / gist:9535894
Created March 13, 2014 20:07
Sublime Text: PHP namespace highlighting patch
--- /Users/Shared/settings/sublime/Packages/PHP/PHP.tmLanguage
+++ /Users/DoubleBlue/Desktop/PHP.tmLanguage.original
@@ -265,7 +265,7 @@
</dict>
</dict>
<key>match</key>
- <string>(?i)\b(new)\s+(\\)*(?:(\$[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)|(\w+))|(\w+)(?=::)</string>
+ <string>(?i)\b(new)\s+(?:(\$[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)|(\w+))|(\w+)(?=::)</string>
</dict>
<key>interpolation</key>
@bakertim
bakertim / gist:9160811
Created February 22, 2014 19:32
objective-c: display all font names
for (NSString* family in [UIFont familyNames])
{
NSLog(@"%@", family);
for (NSString* name in [UIFont fontNamesForFamilyName: family])
{
NSLog(@" %@", name);
}
}
@bakertim
bakertim / gist:9084225
Created February 19, 2014 01:12
Apple-Script: Toggle Hidden Files
if (do shell script "defaults read com.apple.finder AppleShowAllFiles") is equal to "0" then
do shell script "defaults write com.apple.finder AppleShowAllFiles 1"
else
do shell script "defaults write com.apple.finder AppleShowAllFiles 0"
end if
tell application "Finder" to quit
delay 2
launch application "Finder"
@bakertim
bakertim / gist:9036356
Created February 16, 2014 15:57
CLI: Fix preferences not saving (Mac OSX)
chmod -RN ~/Library/Preferences
@bakertim
bakertim / gist:9023123
Created February 15, 2014 18:20
CLI: New machine setup
# initial Computer setup
# Tim Westbaker
# Created 2-15-14
# Git configuration
g config --global alias.b branch
g config --global alias.a add
g config --global alias.c commit
g config --global alias.co checkout
g config --global alias.d diff