Skip to content

Instantly share code, notes, and snippets.

View ahmetozalp's full-sized avatar
💾
Unknow

Ahmet ahmetozalp

💾
Unknow
View GitHub Profile
@tjamps
tjamps / README.md
Last active February 29, 2024 14:57
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@Jpoliachik
Jpoliachik / index.ios.js
Last active August 17, 2021 10:27
ReactNative LayoutAnimation Example
'use strict';
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
TouchableOpacity,
LayoutAnimation,
} from 'react-native';
@timruffles
timruffles / attack.md
Last active November 21, 2020 17:35
Chrome/Gmail attack received 11/03/2016. Not sure if the Chrome meta refresh + data:text,html technique is novel.

The following attack will display a "you've been signed out" page for GMail, and attempt to steal your account credentials.

DO NOT PUT ANY ACCOUNT CREDENTIALS INTO ANY TABS CREATED AFTER VISITING THESE LINKS :)

I received an email in my GMail inbox with a fake attachment image, styled to look like the real GMail attachment UI:

fake

This linked to a page that ended up displaying a fake "you've been signed out" link, via the data:text/html... URL feature of Chrome:

@thoaster
thoaster / MAMP PRO 4 Trial Reset.md
Last active April 7, 2024 16:22
MAMP PRO 4 Trial Reset

MAMP PRO 4 Trial Reset

A simple script that resets latest MAMP PRO 4 trial validity, and keeps your data safe.

How to use

  • Copy the code into a file OR download the script and save it as reset_mamp4.sh
  • Open the Terminal app and write chmod +x then drag and drop the file on the Terminal. You should have something like chmod +x reset_mamp4.sh. Press Enter to run it.
  • Now, run the file itself by dragging and dropping it on the Terminal (something like reset_mamp4.sh) then pressing Enter.
  • Open MAMP PRO and check if you have 14 days left now.

Didn't work?

/* @flow */
import React, { Component } from 'react';
import {
TouchableOpacity,
Image,
View,
Text,
StatusBar,
ScrollView,
Dimensions,
/* @flow */
import React, { PureComponent } from 'react';
import { TouchableHighlight, Image, Dimensions } from 'react-native';
const { width }: { width: number } = Dimensions.get('window');
type node = { node: { image: { uri: string } } };
type State = {};
type Props = {
item: node,
@barnybug
barnybug / docker-compose.yml
Created November 21, 2017 11:14
Docker compose for a Docker-in-docker gitlab runners setup
# Docker-in-Docker Gitlab runners setup taken from:
# https://medium.com/@tonywooster/docker-in-docker-in-gitlab-runners-220caeb708ca
dind:
restart: always
privileged: true
volumes:
- /var/lib/docker
image: docker:17.09.0-ce-dind
command:
- --storage-driver=overlay2
@jacks205
jacks205 / RNMultipleTargetsInstructions.md
Last active February 6, 2024 19:30
Settings up multiple app targets in React-Native
@AntoniusGolly
AntoniusGolly / index.js
Created March 18, 2018 17:17
Sample Node.js script for resizing images with the Sharp library
'use strict';
const AWS = require('aws-sdk');
const S3 = new AWS.S3({
signatureVersion: 'v4',
});
const sharp = require('sharp');
const BUCKET = process.env.BUCKET ? process.env.BUCKET : "mybucket";
const URL = process.env.URL ? process.env.URL : "http://localhost:5858"; // for local development
@superjose
superjose / .gitlab-ci.yml
Last active February 19, 2024 10:22
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.