This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export DISPLAY=:0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# target hosts | |
TO_HOSTS=("${TO_HOSTS[@]}" "web01.example.com") | |
TO_HOSTS=("${TO_HOSTS[@]}" "web02.example.com") | |
# ssh keys | |
SSH_KEYS=("${SSH_KEYS[@]}" "ssh-private-key-for-web01.example.com.pem") | |
SSH_KEYS=("${SSH_KEYS[@]}" "ssh-private-key-for-web02.example.com.pem") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# target hosts | |
TO_HOSTS=("${TO_HOSTS[@]}" "web01.example.com") | |
TO_HOSTS=("${TO_HOSTS[@]}" "web02.example.com") | |
# target directory | |
TO_BASE_DIRECTORY="/remote/directory/" | |
TO_DIRECTORIES=("${TO_DIRECTORIES[@]}" "php/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
is_smart_phone = () -> | |
lower_user_agent = window.navigator.userAgent.toLowerCase() | |
return (lower_user_agent.indexOf('android') != -1 and | |
lower_user_agent.indexOf('android 1.') == -1 and | |
lower_user_agent.indexOf('android 2.') == -1) or | |
(lower_user_agent.indexOf('iphone') != -1 and | |
lower_user_agent.indexOf('iphone os 2_') == -1 and | |
lower_user_agent.indexOf('iphone os 3_') == -1) | |
redirect_to_sp = () -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implement MyScrollViewDelegate | |
{ | |
UIImageView *currentImageView; | |
UIImageView *nextImageView; | |
UIImageView *previousImageView; | |
NSInteger currentPhotoIndex; | |
NSArray *photos; | |
} | |
- (void)resetPhotoSlideImageViews |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension String { | |
subscript(range:Range<Int>) -> String { | |
return self[advance(self.startIndex, range.startIndex)..advance(self.startIndex, range.endIndex)] | |
} | |
} | |
var s = "abcdefghij" | |
s[1..4] // print "bcd" | |
s[1...4] // print "bcde" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
File Name: upload_s3.py | |
Usage: python upload_s3.py | |
""" | |
import sys | |
import os | |
import os.path | |
import fnmatch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class InstagramOAuth { | |
const CLIENT_ID = Configuration::INSTAGRAM_CLIENT_ID; | |
const CLIENT_SECRET = Configuration::INSTAGRAM_CLIENT_SECRET; | |
const CALLBACK_URL = Configuration::INSTAGRAM_CALLBACK_URL; | |
public static function getAuthorizationURL($state = null, $scope = InstagramScope::BASIC, $is_implicit_authentication = false) { | |
$scope = $scope == null ? InstagramScope::BASIC : $scope; | |
$response_type = !$is_implicit_authentication ? 'code' : 'token'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ThumbnailUtility { | |
const TYPE_KEEP_RATIO = 0; | |
const TYPE_TRIM = 1; | |
public static function Resize( | |
$file_path_or_url, | |
$thumbnail_width = null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: $(".ProfileCard-avatarImage").each(function() { $avatarImg = $(this); $avatarImg.attr("src", $avatarImg.attr("src").replace("_bigger", "_400x400")); }); |
OlderNewer