Skip to content

Instantly share code, notes, and snippets.

View oelna's full-sized avatar
😔
The light inside has broken, but I still work

Arno Richter oelna

😔
The light inside has broken, but I still work
View GitHub Profile

This is a crash course in JavaScript. It is intended for people who already have a bit of programming experience in other languages.

This will hopefully give a basic idea of the most-commonly-used language features, but it is not indended to be a comprehensive guide.

This guide was last updated in August 2016.

Basic syntax

To declare a variable called foo:

@johanhar
johanhar / uic9183aztecbarcodedecoding.m
Last active November 13, 2017 07:33
uic-918-3 aztec barcode decoding ios objective-c
// add this method to ZXAztecDecoder.m (ZXingObjC)
+ (NSString *)UIC9183TicketId:(ZXBoolArray *)correctedBits
{
NSMutableData *bytes = [[NSMutableData alloc] init];
int endIndex = (int)correctedBits.length;
ZXAztecTable latchTable = ZXAztecTableUpper; // table most recently latched to
ZXAztecTable shiftTable = ZXAztecTableUpper; // table to use for the next read
@andreif
andreif / AppDelegate.swift
Created March 16, 2016 22:15
Example of UIPageViewController without storyboard i.e. created programmatically
// derived from https://www.veasoftware.com/posts/uipageviewcontroller-in-swift-xcode-62-ios-82-tutorial
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController()
Here are a few questions that will tee us up for a good conversation:
- Can you tell me about your project in a few sentences?
- What’s the timeframe? Does a certain event depend on this project launching?
- What are you looking for from us? Do you want us to design, build, and launch the whole site? Or do you have developers or other partners lined up and only need us for design?
- Have you already started on any part of the project? Do you have existing work? A new logo? Some rough designs or ideas for the site?
- How large is your team? What are the roles you envision on your end?
- How did you hear about our work? What specifically interests you about it? Any projects that you’re keen on?
- How much money have you set aside for this project?
- Are you talking to others about this project? Might we ask how many? What do you like about their work?
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@rasms
rasms / .htaccess
Created January 22, 2015 19:52
standard htaccess for caching and compression
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/html "access plus 1 day"
ExpiresByType text/php "access plus 1 day"
@appnus
appnus / twitch-chat.php
Last active April 17, 2022 10:25
PHP Twitch Chat Client
#!/usr/bin/env php
<?php error_reporting(E_ALL); set_time_limit(0);
if (php_sapi_name() !== "cli" || $argc < 4) {
echo "Usage: php ", $argv[0], " [nickname] [password] [#channel]";
exit(1);
}
$host = "irc.twitch.tv";
$ip = gethostbyname($host);
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@alejandro-isaza
alejandro-isaza / String+Parsing.swift
Last active February 24, 2018 18:10
Swift Character and String extensions for parsing.
import Foundation
public extension Character {
/// Determine if the character is a space, tab or newline
public func isSpace() -> Bool {
return self == " " || self == "\t" || self == "\n" || self == "\r"
}
/// Conver the character to a UTF16 code unit
public var utf16: UInt16 {

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs