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 | |
SRCDIR=$HOME/PUT_SOURCE_DIRECTORY_HERE | |
DSTDIR=$HOME/PUT_DESTINATION_DIRECTORY_HERE | |
REMOTE_SHARE=PUT_SERVER_NAME_HERE/PUT_NAME_OF_SHARE_HERE | |
KEYCHAIN_SERVICE_TOKEN=CHANGE_TO_NAME_OF_SERVICE_AS_STORED_IN_KEYCHAIN | |
USERNAME=ola | |
PASSWORD=$(security find-generic-password -s $KEYCHAIN_SERVICE_TOKEN -w) | |
if [ ! -d "$DSTDIR" ]; then |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys, os, subprocess | |
from datetime import datetime | |
oldrev, newrev, branch = sys.stdin.read().split() | |
refs, head, branch = branch.split('/') | |
deploy_to = None |
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
@keyframes hammer { | |
from,20%,53%,80%,to { | |
-webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); | |
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); | |
-webkit-transform: translate3d(0, 0, 0); | |
transform: translate3d(0, 0, 0) | |
} | |
40%,43% { | |
-webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); | |
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); |
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
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
import sys, subprocess | |
from os import chdir | |
from glob import glob | |
FFMPEG = 'D:\\Developer\\ffmpeg.exe' | |
FFPROBE = 'D:\\Developer\\ffprobe.exe' |
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
result = [a[:] for a in [[' '] * h] * w] |
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
#include <string> | |
#include "mt.h" | |
warmupRNG(); | |
std::uniform_int_distribution<int> rollTheDice(1, 6); | |
for (int i = 0; i < 1000; ++i) | |
std::cout << rollTheDice(gRNG()) << ", "; | |
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
std::string createGUIDString(void) { | |
GUID guid; | |
HRESULT hCreateGuid = CoCreateGuid(&guid); | |
std::stringstream strBuf; | |
strBuf << std::hex << std::setw(8) << std::setfill('0') | |
<< guid.Data1 << "-" << guid.Data2 << "-" << guid.Data3 << "-"; | |
for (int i = 0; i < 2; ++i) | |
strBuf << std::hex << std::setw(2) << std::setfill('0') << short(guid.Data4[i]); | |
strBuf << "-"; | |
for (int i = 2; i < 8; ++i) |
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
#include <boost/algorithm/string/predicate.hpp> | |
struct BoolTranslator | |
{ | |
typedef std::string internal_type; | |
typedef bool external_type; | |
// Converts a string to bool | |
boost::optional<external_type> get_value(const internal_type& str) | |
{ |
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
// using Qt | |
QByteArray shuffled(const QByteArray &ba) | |
{ | |
QByteArray result = ba; | |
int n = result.count(); | |
char *c = result.data(); | |
while (n) { | |
int j = qrand() % n--; | |
char tmp = *(c + n); |
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
param([bool]$enable) | |
$signature = @' | |
[DllImport("user32.dll")] | |
public static extern bool SystemParametersInfo( | |
uint uiAction, | |
uint uiParam, | |
uint pvParam, | |
uint fWinIni); | |
'@ |