Skip to content

Instantly share code, notes, and snippets.

View aerykk's full-sized avatar
💭
git push --janken

aerykk aerykk

💭
git push --janken
View GitHub Profile
@atraver
atraver / ServerRequestManager.cs
Created June 20, 2016 23:04
UnityWebRequest Dispose example
private IEnumerator ExecuteRequest<T>(BuildRequestDelegate builder, ResponseDelegate<T> callback,
Action cancelCallback, RequestOptions requestOptions)
{
using(UnityWebRequest serverRequest = builder())
{
bool showActivityIndicator = ((requestOptions & RequestOptions.ShowActivityIndicator) == RequestOptions.ShowActivityIndicator);
bool forceRetry = ((requestOptions & RequestOptions.ForceRetry) == RequestOptions.ForceRetry);
float startTime = Time.realtimeSinceStartup;
yield return serverRequest.Send();
//=====================
// Palindrome
//=====================
function removeSpecialChars(str){
return str.replace(/[^A-Z0-9]/ig, "");
}
function lowerCase(str){
return str.toLowerCase();
}
var dom = Bloop.dom;
var Box = Bloop.createClass({
getInitialState: function() {
return { number: 0 };
},
updateNumber: function() {
this.state.number++;
},
@dideler
dideler / bootstrapping.md
Last active May 8, 2024 14:38
Bootstrapping - a list of useful resources to get up and running quickly

Welcome!

UPDATE: This list is no longer maintained. I've moved it to its own repo so you can send suggestions as Pull Requests. https://github.com/dideler/bootstrapping/

For feedback or suggestions, please send a tweet (@dideler). Gist comments don't notify me. Pull requests aren't possible with gists (yet), so I don't recommend forking because then I can't easily get the change.

Starring this gist will give me an idea of how many people consider this list useful.

@Josh-Miller
Josh-Miller / landing.js
Created May 26, 2011 21:58 — forked from anonymous/landing.js
updating data on first window load
/* UPDATING DATA */
// 1. compare dates in two update files (if OK internet connection)
var update = Titanium.App.Properties.getString('update');
if (Titanium.Network.online && update == 'YES') {
var newUpdatesFile = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'newUpdates.txt');
var savedFile = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory+Titanium.Filesystem.separator,'lastUpdated.txt');
var lastUpdatedDate = savedFile.read();
var newUpdatesDate = newUpdatesFile.read();
@romannurik
romannurik / centered_triangle.html
Created May 3, 2011 05:43
A simple CSS trick to create a horizontally- or vertically-centered 'selected' callout triangle using zero images.
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 40px;
}
a {
display: inline-block;
@dtjm
dtjm / file-dialog-filters.diff
Created July 26, 2010 22:58
A script to install qcachegrind (the QT version of KCacheGrind) from the source tree at the KDE project. It will also install QT from homebrew with the required dependencies (which takes about 2 hours).
Index: qcachegrind/qcgtoplevel.cpp
===================================================================
--- qcachegrind/qcgtoplevel.cpp (revision 1155013)
+++ qcachegrind/qcgtoplevel.cpp (working copy)
@@ -792,7 +792,7 @@
file = QFileDialog::getOpenFileName(this,
tr("Open Callgrind Data"),
_lastFile,
- tr("Callgrind Files (callgrind.*)"));
+ tr("Cachegrind Files (*cachegrind.*);;Callgrind Files (*callgrind.*);;All Files (*)"));