Skip to content

Instantly share code, notes, and snippets.

@MrJackdaw
MrJackdaw / api-config.example.js
Last active August 9, 2021 00:44
SPA Core | Application State and Network Manager
import APIconfig from "./api-config";
// SECTION 1: Create Your endpoints.
// For separation of concerns, you can create these in a separate file
// and import them wherever you create your `APIConfig` instance.
//
// Note: the following is entirely mocked (i.e. not a real API that
// I know of), but is meant to convey the idea of using `APIConfig`.
const MY_BASE_URL = "https://api.example.com"
@MrJackdaw
MrJackdaw / animations.scss
Last active August 19, 2021 00:54
CSS Quick-Start
/******************************************
* File : Animations.scss
*******************************************/
@keyframes beacon {
0% {
transform: scale(1, 1);
opacity: 1;
}
100% {
transform: scale(4, 4);
package main
import (
"net"
"os"
)
func main() {
strEcho := "Halo"
servAddr := "localhost:6666"
tcpAddr, err := net.ResolveTCPAddr("tcp", servAddr)
@ynechaev
ynechaev / gist:8123997
Last active June 9, 2017 23:18
UITableViewCell popular animation (flipping around Y axis, depending on scroll direction)
@interface YourViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
UIImageOrientation scrollOrientation;
CGPoint lastPos;
}
- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
if (tableView.isDragging) {
UIView *myView = cell.contentView;
CALayer *layer = myView.layer;
CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity;