Skip to content

Instantly share code, notes, and snippets.

View srph's full-sized avatar
🛠️
Building @Stride-Labs Frontend

Kier Borromeo srph

🛠️
Building @Stride-Labs Frontend
View GitHub Profile
@domenic
domenic / 0-github-actions.md
Last active May 26, 2024 07:43
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
var isValidURL = (function () {
var input = document.createElement('input');
input.type = 'url';
function isValidURL(url) {
input.value = url;
return input.validity.valid;
}
return isValidURL;
Hindi ba pwedeng simpleng "Mahal kita"?
yung lang naman gustong marinig ng kahit sino diba?
Walang namilit sayo, walang nagmakaawa. Sinabi ko lang
naman yung nararamdaman ko dahil hindi ko na kayang itago yun.
Pwede namang lumayo ka na lang, pwede namang iniwasan mo na lang
ako maiintindihan ko pa yun. Pero shinota mo ko e
shinota mo ang bestfriend mo. Pero nung bumalik sya
pinatalo mo ang lahat. Pati ako pinatalo mo :'(
@volkovasystems
volkovasystems / CountdownControl.js
Last active August 29, 2015 14:10 — forked from srph/CountdownControl.js
A revision of countdown timer made with React way of thinking.
var CountdownControl = React.createClass({
// Simplified for brevity
render: function() {
var control = this.props.status
? 'Pause'
: 'Resume';
return (
<span onClick={this._handleClick}>
@koistya
koistya / ReactJS-Server-Side-Rendering.md
Last active September 15, 2023 07:32
Server-side Rendering (SSR) for ReactJS / Flux Applications. Setting document.title

Files

The basic structure of a React+Flux application (see other examples)

 - /src/actions/AppActions.js     - Action creators (Flux)
 - /src/components/Application.js - The top-level React component
 - /src/constants/ActionTypes.js  - Action types (Flux)
 - /src/core/Dispatcher.js        - Dispatcher (Flux)
 - /src/stores/AppStore.js        - The main store (Flux)
@crucialfelix
crucialfelix / angular-speedball.js
Last active August 29, 2015 14:06
Angular Speedball - a jasmine testing utility to eliminate boilerplate in testing
'use strict';
/**
*
* An Angular Jasmine testing utility
*
* @copyright 2013 Chris Sattinger
* MIT License
*
* automatically injects these services:
* '$httpBackend', '$rootScope', '$controller', '$compile'
@spoike
spoike / webapi_example.js
Last active May 12, 2017 13:37
Simple WebAPI example
var PostsApi = require('webapi/posts'),
// assuming the api object from the jsbin snippet
Reflux = require('reflux');
var PostActions = createActions(["load", "loadError"]);
// load action is invoked either from:
// * top most component's componentDidMount
// function in your application, or
// * window.onLoad
// I prefer the first strategy because that'll
@jtangelder
jtangelder / PreventGhostClick.js
Last active November 19, 2024 14:11
PreventGhostClick
/**
* Prevent click events after a touchend.
*
* Inspired/copy-paste from this article of Google by Ryan Fioravanti
* https://developers.google.com/mobile/articles/fast_buttons#ghost
*
* USAGE:
* Prevent the click event for an certain element
* ````
* PreventGhostClick(myElement);
@staltz
staltz / introrx.md
Last active April 24, 2025 06:10
The introduction to Reactive Programming you've been missing
@insin
insin / 1.js
Created May 7, 2014 05:29
This is the sort of stuff JSX saves you from having to manage
this.$el.append(domBuilder([
['div.arrow']
, ['div.popup-header'
, ['button.close', {type: 'button'}, '\u00D7']
, ['h3', 'Add menu item']
]
, ['div.popup-body'
, ['form.form-horizontal'
, ['div.control-group'
, ['label.control-label', {'for': 'menuItemType'}, 'Type']