Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View helsont's full-sized avatar
🎯

Helson Taveras helsont

🎯
View GitHub Profile
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
NSLog(@"didReceiveNotification");
// Get application state for iOS4.x+ devices, otherwise assume active
UIApplicationState appState = UIApplicationStateActive;
if ([application respondsToSelector:@selector(applicationState)]) {
appState = application.applicationState;
}
if (appState == UIApplicationStateActive) {
[
{
"dateCreated": "2015-08-16T20:34:10.682Z",
"expirationDate": "2015-08-16T21:09:10.667Z",
"note": "",
"canceled": false,
"expired": false,
"exchangedGiver": false,
"exchangedRequester": false,
"id": "55d0f3c27712c2ccd4a7af50",
commentEditText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
// 200 is an arbitrary amount of time to let the keyboard show, and then
// we smooth scroll
recyclerView.postDelayed(new Runnable() {
@Override
public void run() {
recyclerView.smoothScrollToPosition(adapter.getItemCount() - 1);
Request.remoteMethod(
'getNumPresentStudents',
{
description: 'Get all givers in the specified DiningHall.',
accessType: 'READ',
accepts: [
{arg: 'diningHallId', type: 'string', required: true, description: 'The specified DiningHall.'}
],
http: {path: '/getNumPresentStudents', verb: 'get'},
returns: {type: 'number', root: true}
#include <stdio.h>
void setint(int*, int);
int main() {
int a;
seti t(& 10) tint(&a, 10);
printf("%dn", a);
int* b;
#include<stdio.h>
#include<stdlib.h>
int main()
{
unsigned char;
FILE *fp;
fp=fopen("trial", "r");
if(!fp)
{
<div class="row">
<div class="col-sm-12 contact-form wow fadeInUp">
<form role="form" action="assets/contact.php" method="post">
<div class="form-group">
<label class="sr-only" for="contact-email">Email</label>
<input type="text" name="email" placeholder="Email..." class="contact-email form-control" id="contact-email">
</div>
<div class="form-group">
<label class="sr-only" for="contact-subject">Subject</label>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
char *str1, *str2, *token, *subtoken;
char *saveptr1, *saveptr2;
int j;
'use strict';
module.exports = function(Model, options) {
let property = options.property;
// Use 'ignoreFilters' to access deleted data.
Model.observe('access', function filterDelted(ctx, next) {
if (!ctx.query.ignoreFilters) {
if (!ctx.query.where) {
ctx.query.where = {};
}
@helsont
helsont / vs.sh
Created May 14, 2016 17:12
If you attempt to simultaneously ssh into the sam vagrant box from several different terminals, you will more often than not get an error message that the box is unavailable. This script sleeps for a random period of time and then executes vagrant ssh, resolving the issue.
#!/bin/bash
SLEEPTIME=$RANDOM
SLEEPTIME=$((SLEEPTIME%20))
SLEEPTIME=$(echo "$SLEEPTIME/10" | bc -l)
printf "waiting..."
# printf "time: %f\n" "$SLEEPTIME"
sleep $SLEEPTIME
vagrant ssh